package com.frame.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.frame.dao.AccountDao;
import com.frame.entity.Account;
import com.frame.utils.DaoSupport;

@Repository
public class AccountDaoImpl implements AccountDao {

	@Autowired
	private DaoSupport daoSupport;
	
	@Override
	public Account read(String username) {
		Account account = null;
		try {
			account = daoSupport.getBeanByProperty("account", Account.class, "username", username);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return account;
	}

	@Override
	public Account read(Integer id) {
		Account account = null;
		try {
			account = daoSupport.getBeanById("account", Account.class, id);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return account;
	}

	@Override
	public Account register(Account account) {
		// TODO Auto-generated method stub
		return null;
	}
	
}
